import request from '@/utils/request';
// 后期优化开发环境和生产环境使用
const encryption = '/encryption';

/**
 * 获取图片列表
 */
export function getImgList(params) {
  return request({ url: `/api/conf-picture${encryption}/v1/list`, method: 'post', data: params });
}

/**
 * 新增图片信息
 */
export function saveRequest(params) {
  return request({ url: `/api/conf-picture${encryption}/v1/save`, method: 'post', data: params });
}

/**
 * 编辑图片信息
 */
export function updateRequest(params) {
  return request({ url: `/api/conf-picture${encryption}/v1/update`, method: 'post', data: params })
}

/**
 * 删除图片信息
 */
export function deleteRequest(params) {
  return request({ url: `/api/conf-picture${encryption}/v1/delete`, method: 'post', data: params })
}

/**
 * 上传图片
 */
export function fileRequest(params) {
  return request({
    url: `/vietnam-travel-admin/configurationManagement/v1/upload-file`,
    method: 'post',
    data: params,
    responseType: 'upload'
  })
}

/**
 * 公告启用或禁用
 */
export function switchRequest(params) {
  return request({ url: `/api/conf-picture${encryption}/v1/switch`, method: 'post', data: params })
}